<?php
class Index_con extends Lxbase {
	public function index(){
		if(!empty($_SESSION["hyid"])){
		$this->smarty->assign("hyid",$_SESSION["hyid"]);
		}
        if($this->basehost=='http://qiyuenew.zhongsou.com/' || $this->basehost=='http://qiyue.zhongsou.com/'){
            $shopurl = "http://weidian.zhongsou.com/";
        }else{
            $shopurl = "http://weidian1.zhongsou.com/";
        }
		if($this->basehost=='http://kaifa.zq.zhongsou.com/' || $this->basehost=='http://zq.zhongsou.com/'){
			$vqhost = "http://kaifa.vq.zhongsou.com";
			$this->smarty->assign("debug",1);
		}else{
			$vqhost = "http://vq.zhongsou.com";
		}
		$usertoken = $this->oncedata("token","users","where id={$this->userinfo['userid']}");
        $this->smarty->assign("shopurl",$shopurl);
		$this->smarty->assign("basehost",$this->basehost);
        $this->smarty->assign("u",$this->userinfo['userid']);
		$this->smarty->assign("uname",$this->userinfo['uname']);
		$this->smarty->assign("plas",$this->userinfo["plas"]);
		$this->smarty->assign("vqhost",$vqhost);
		$this->smarty->assign("usertoken",$usertoken);
		$this->smarty->display("index.tpl");
	}
	
	/**
	 * 选择平台
	 */
	public function platform(){
		//取出浏览记录	
		$historys = $this->mongo()->findOne('history', array("uid"=>$_SESSION['userinfo']['uid'])); 
		if($historys){
			//有浏览记录
			$mids = explode(',', $historys['mid']);
			$modules = $this->getconfig('module');
			$his = array();
			foreach ($mids as $v){
				$his[$v] = $modules[$v];
			}
		}else{
			$his = array();
		}
		$this->smarty->assign('his',$his);
	 	$this->smarty->assign('gid',$_SESSION['userinfo']['gid']);
	 	$this->smarty->display("inside.tpl");
	} 
	
	/**
	 * 微应用管理
	 */
	public function wxpla(){
		if($this->basehost=='http://kaifa.zq.zhongsou.com/' || $this->basehost=='http://zq.zhongsou.com/'){
			$this->smarty->assign("debug",1);
		}
		$this->smarty->assign("u",$this->userinfo["userid"]);
		$this->smarty->display('wxpla.tpl');	
	}
	
	/**
	 * APP管理
	 */
	public function apppla(){
		if($this->basehost=='http://kaifa.zq.zhongsou.com/' || $this->basehost=='http://zq.zhongsou.com/'){
			$this->smarty->assign("debug",1);
		}
		$this->smarty->assign("u",$this->userinfo["userid"]);
		$this->smarty->display('apppla.tpl');
	}
	
	/**
	 * 名企管理
	 */
	public function companys(){
		if($this->basehost=='http://kaifa.zq.zhongsou.com/' || $this->basehost=='http://zq.zhongsou.com/'){
			$this->smarty->assign("debug",1);
		}
		$this->smarty->assign("u",$this->userinfo["userid"]);
		$this->smarty->display('companys.tpl');
	}
	
	/**
	 * 支付宝服务窗
	 */
	public function alip(){
		$this->smarty->assign("u",$this->userinfo["userid"]);
		$this->smarty->display('alip.tpl');
	}
	
	/**
	 * 百度直达号
	 */
	public function zhida(){
		$this->smarty->assign("u",$this->userinfo["userid"]);
		$this->smarty->display('bdindex.tpl');
	}
	
	/**
	 * 中搜搜悦
	 */
	public function souyue(){
		$this->smarty->assign("u",$this->userinfo["userid"]);
		$this->smarty->display('zsindex.tpl');
	}
}